The Joint Photographic Experts Group (JPEG) and JPEG 2000 are well known international standards of a method of compressing image data.
FIG. 1 is a schematic diagram for explaining a conventional image processing apparatus that compresses image information by JPEG 2000. When image data 11 are input to an image processing apparatus 12, the image data 11 are transformed with discrete wavelet transformation (DWT) by a transforming unit 13, are quantized by a quantizing unit 14, are encoded with entropy coding by an encoding unit 15, and are output as encoded data 16. That is, the image information is compressed in the manner in which the image data 11 are transformed into the encoded data 16.
In this specification, the “image information” includes the image data 11 and any data derived from the image data 11 such as the transformed image data, the quantized image data, and the encoded image data encoded with the entropy encoding.
FIG. 2 is a schematic diagram showing a conventional image processing apparatus that decompresses the image information. When encoded data 21 are input to an image processing apparatus 22, the encoded data 21 are decoded with entropy decoding by a decoding unit 23, are reversely quantized by a reverse quantizing unit 24, are reversely transformed with reverse discrete wavelet transformation by a reverse transforming unit 25, and are output as image data 26. That is, the image information, the encoded data 21 in this case, is decompressed into the image data 26.
The image processing apparatus that compresses the image information and the image processing apparatus that decompresses the image information are often combined as an image processing system.
The transforming unit 13 will be described by reference to FIGS. 3A and 3B. In the case of JPEG 2000, the image data 11 are generally divided into tiles 31 as showed in FIG. 3A. Each tile 31 is transformed with DWT as showed in FIG. 3B. FIGS. 3A and 3B illustrate the case in which the image data 11 are divided into the tiles 31 of 128×128 pixels. If a tile 31 of 128×128 pixels is transformed with DWT of level 2, the transformation generates wavelet coefficient data 32 for three 64×64 sub-bands 1LH, 1HL, and 1HH and four 32×32 sub-bands 2LL, 2LH, 2HL, and 2HH.
The quantizing unit 14 will be described by reference to FIG. 4. FIG. 4 shows an example of formula to be used for quantizing, where “a” and “b” are the wavelet coefficients before and after quantizing, respectively; “|a|” is the absolute value of “a”; “sign(a)” is the sign of “a”; “[ ]” is floor function; and “Δ” is a quantizing step. The wavelet coefficient “a” is quantized to “b” by this formula.
The encoding unit 15 will be described by reference to FIG. 5. In the case of JPEG 2000, the sub-band 52 of the quantized wavelet coefficient data 51 is divided into code blocks 53 as showed in FIG. 5A. (If a sub-band is larger than a code block, the sub-band is divided into the code clocks. In the following description, a code block includes a sub-band that is not divided into code blocks.)
The code blocks 53 are further divided into bit planes 54 as showed in FIG. 5B. Each bit plane is encoded with entropy encoding such as arithmetic encoding as showed in FIG. 5C. FIG. 5A illustrates the case in which the sub-band 52 is divided into the 4×4 code blocks 53. (The size of each code block 53 is 4×4 in this case, but the size is not limited to 4×4.) FIG. 5B illustrates the case in which the 4×4 code block 53 is divided into four bit planes 54. The encoding unit 15 encodes with entropy encoding each bit plane 54 of the quantized wavelet coefficient data 51, and outputs the encoded data 16.
In the above description, the image data 11 are assumed to represent a monochrome image. In the case in which the image data 11 represent a color image, the image data (component) of each color can be input to the image processing apparatus 12 as showed in FIGS. 6A and 6B. The image data represented by RGB format may be directly input to the image processing apparatus 12 as showed in FIG. 6A. The image data represented by RGB format may be converted into another format such as YCbCr format before being input to the image processing apparatus. In the case of JPEG 2000, the image data represented by the RGB format are generally converted into the YCbCr format as showed in FIG. 6B. Since human eyes are not as sensitive to the color difference components (Cb and Cr) as they are to the brightness component (Y), one can increase data compression rate by compressing Cb and Cr more than Y.
As described above, in the case of JPEG 2000, the quantized wavelet coefficient data are divided into bit planes, and encoded by the bit plane. If some bit planes are cut off, the image data are further compressed. For example, the image data can be compressed by cutting off (truncating) the lower side of the encoded bit planes.
If a compression ratio is given as a target, data are cut off until the compression ratio reaches the target. If data are cut off, image quality is degraded. Accordingly, it is necessary to determine, when the data are cut off to a certain extent, how much the image quality degrades.
According to a method of determining the extent of the degrading showed in “Example and Guideline” (EG) of JPEG 2000, the bit planes are truncated one by one from the lowest bit plane to the highest bit plane, and the distortion is obtained after each truncation of a bit plane. For example, the lowest bit plane is truncated, and the distortion is obtained. Then, the second lowest bit plane is additionally truncated, and the distortion is obtained. This procedure is continued until the highest bit plane is truncated and the distortion is obtained. The distortion is obtained by decoding the encoded data after each truncation and comparing the decoded data with the original image data. The distortion is defined as mean squared error (MSE).
Since the encoded data after each truncation are decoded as described above, it takes long time to obtain the distortion. Otherwise, hardware that accelerates the above procedure is additionally required.